//
//  XHActivityViewController.swift
//  testApp
//
//  Created by ColdMountain on 2017/1/20.
//  Copyright © 2017年 ColdMountain. All rights reserved.
//

import UIKit

class XHActivityViewController: YNBaseViewController,UIWebViewDelegate {

    var ID:String!
    var webViewDic:NSDictionary=[:]
    
    @IBOutlet weak var ui_webView: UIWebView!
    override func viewDidLoad() {
        super.viewDidLoad()
        self.ui_webView.scrollView.bounces=false
    }

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(true)
        activityDeatilFunction(ID: ID)
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    func activityDeatilFunction(ID:String){
        postActivityDetails(ID: ID, success: { (data) -> (Void) in
            self.webViewDic=data as! NSDictionary!
            self.loadHtmlToString()
        }, failure: { (data) -> (Void) in
            
        })
    }
    func loadHtmlToString(){
        self.ui_webView.loadHTMLString(self.webViewDic["content"]! as! String, baseURL: nil)
    }
    
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
